<?php
/*
Overmundo, cultura de todo o Brasil
Desenvolvido pela Tecnopop para o Núcleo de Idéias Movimento
Copyright (C) 2006  Núcleo de Idéias Movimento

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

header("Expires: ".gmdate("D, d M Y H:i:s")."GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-type: text/css; charset=iso-8859-1"); 


require('../lib/class.site.php');
require('../lib/class.overmundo.php');
require('../lib/class.conecta.php');
//require('../lib/class.colaborador.php');


if ($_GET["estado"]) {
	$siglaEstado = $_GET["estado"];
}


	$minhaConexao = new Conecta();
	$meuSite = new Overmundo();
	$meuSite->linkid = $minhaConexao->linkid;
//	echo "GET " . $_GET["selec"];
	if (!($valorSelecionado = $_GET["selec"])) {
		$valorSelecionado = "--NOP--";
	}
									?>
<div style="padding-bottom:11px; margin-left:12px; width:90%;">
									<div style="float:left; margin-right:5px; height:22px; vertical-align:middle">estado</div> 
										<select name="slcEstado" id="slcEstado"  onChange="requisitos();" onLoad="requisitos()"; class="inscricoes">
		                                <option value="0" selected>Selecione...</option><?
 $resEstados = $meuSite->OvermundoListaEstados(" estadoMunicipio != 'WW'", "");
 	while ($row = mysql_fetch_array($resEstados)){
        $meuSite->insertOption($row["estadoMunicipio"] , $row["estadoMunicipio"], 1, ($siglaEstado != "??" ? $siglaEstado : "--NOP--"));
	}
?>
		                                </select>
		                                </div>
                                        <div style="padding-bottom:11px; margin-left:12px; width:90%;" >
									<div style="float:left; margin-right:5px; height:22px; vertical-align:middle">cidade</div>
									<div id="resultadoMunicipio">
									  <select name="slcCodMunicipio"  class="inscricao" <? if (!$siglaEstado) { echo "disabled='disabled'";}?>>
                                        <option value="0" selected>Selecione primeiro um estado...</option>
<?
if ($valorSelecionado) {
		$resMunicipios = $meuSite->OvermundoListaMunicipios("estadoMunicipio = '" . $siglaEstado . "'", " nomeMunicipio ");
 	while ($row = mysql_fetch_array($resMunicipios)){
        $meuSite->insertOption($row["codMunicipio"] , $row["nomeMunicipio"], 1, $valorSelecionado);
        //echo $row["codMunicipio"] .  $row["nomeMunicipio"] . "<BR>";
	}
} else {
		$resMunicipios = $meuSite->OvermundoListaMunicipios("estadoMunicipio = '" . $siglaEstado . "'", " nomeMunicipio ");
 	while ($row = mysql_fetch_array($resMunicipios)){
        $meuSite->insertOption($row["codMunicipio"] , $row["nomeMunicipio"], 1, "--NOP--");
        //echo $row["codMunicipio"] .  $row["nomeMunicipio"] . "<BR>";
	}
}
?>                                </select></div>
                                </div>
								